#ifndef GRAPH_H
#define GRAPH_H
#include <edge.h>
#include <QVector>
#include <QGraphicsItem>
#include <QtGui>
#include <QPen>
#include <QColor>
#include "mapelement.h"
#include <iostream>


class Graph : public QGraphicsItem
{
public:
   // QVector<QList<Edge*>* > m_edges;

    QList<Node* > m_nodes;
    Graph(){}

    void addNode(Node* n);

    Node* getNode(int i)
    {
        return m_nodes.at(i);
    }

    Node* isExist(QPoint pos)
    {
       foreach(Node* n, m_nodes)
        {
            if(n->getPos()==pos)
            {
              return n;
            }
        }
        return NULL;
    }


    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
    QRectF  boundingRect() const;
    void    setBoundingRect(QRectF);


protected:
    QRectF m_boundingRect;

};

#endif // GRAPH_H
